<template>
	<view class="p-t-30">
		<view class="textareaBox">
			<textarea name="text" id="1" maxlength="100" cols="30" rows="10" v-model="content"></textarea>
			<view class="abBox">{{content.length}}/100</view>
		</view>
		<view class="p-30 m-t-100">
			<button @click="submit">提交意见</button>
		</view>
		
		<uv-toast ref="uToast"></uv-toast>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				content:''
			};
		},
		
		methods:{
			submit() {
				this.$api.sendRequest({
					url:'/api/user/feedback',
					data:{
						content:this.content
					},success:res=> {
						this.$refs.uToast.show({
							type: 'default',
							message: res.msg,
							duration:2000
						})
						if(res.code==1) {
							setTimeout(()=>{
								uni.navigateBack()
							},2000)
						}
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	.textareaBox {
			width: 642rpx;
			height: 356rpx;
			position: relative;
			margin: 0 auto;
			.abBox {
				position: absolute;
				right: 10rpx;
				bottom: 10rpx;
			}
			textarea {
				width: 602rpx;
				height: 316rpx;
				opacity: 1;
				border: 2rpx solid rgba(229, 233, 239, 1);
				margin: 0 auto;
				padding: 20rpx;
			}
		}
</style>
